package com.example.spring.boot.api.user.createuser.impl;

import com.example.spring.boot.api.user.createuser.CreateUserRequest;
import com.example.spring.boot.api.user.createuser.CreateUserResponse;
import com.example.spring.boot.business.user.UserModel;
import org.springframework.stereotype.Service;

@Service
public class CreateUserServiceConvert {

    public UserModel toUserModel(CreateUserRequest createUserRequest){
        return UserModel.createBy(createUserRequest);
    }
    public CreateUserResponse toCreateUserResponse(UserModel userModel){
        CreateUserResponse createUserResponse = new CreateUserResponse();
        userModel.inject(createUserResponse);
        return createUserResponse;
    }
}
